﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MCWorldLibrary
{
    class Heightmap
    {
        int[] heightmapData;

        public Heightmap(NBT.IntArrayPayload data)
        {
            this.heightmapData = data.Value;
        }

        public void TrySet(int x, int y, int z)
        {
            int index = (z * 16) + x;
            if (heightmapData[index] < y)
                heightmapData[index] = y;
        }

        public void Set(int x, int y, int z)
        {
            int index = (z * 16) + x;
            this.heightmapData[index] = y;
        }
    }
}
